/**
 * 
 */
package edu.scheduler.valueobject;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Admin
 * 
 */
public class BusinessTimestamp extends Date {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3004318694344197052L;

	private Date date;

	public BusinessTimestamp(String strTimestamp) {
		try {
			this.date = getDateFormat().parse(strTimestamp);

		} catch (ParseException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public String toString() {
		return getDateFormat().format(date);
	}

	/**
	 * @return
	 */
	private SimpleDateFormat getDateFormat() {
		SimpleDateFormat dateFormat = new SimpleDateFormat(
				"dd-MMM-YYYY hh:mm aaa");
		return dateFormat;
	}

}
